#include "mytool.h"
#include <QDir>
#include <QDebug>

MyTool::MyTool(QObject *parent) : QObject(parent)
{
//    qInfo()<<__FUNCTION__;
//    qInfo()<<getMeshs();
}

QStringList MyTool::getMeshs()
{
    QStringList filters;
    filters<<"*";
    QStringList output;

    QStringList filters2;
    filters<<"*.mesh";

    QFileInfoList list = QDir::current().entryInfoList(filters,QDir::NoDotAndDotDot | QDir::AllEntries,QDir::NoSort);

    for(int i=0;i<list.length();i++){

        QFileInfo fileInfo = list.at(i);

        if(fileInfo.isDir()){
            //目录
            QFileInfoList list1 = QDir(fileInfo.filePath() + "/meshes/").entryInfoList(filters2,QDir::NoDotAndDotDot | QDir::AllEntries,QDir::NoSort);

             for(int j=0;j<list1.length();j++){
                 QFileInfo fileInfo1 = list1.at(j);
                 if(fileInfo1.isDir()){
                 }
                 else{
                     output.append(fileInfo1.filePath());
                 }
             }
        }
        else{
            //文件
        }
    }
    return output;
}
